<template>
    <el-dialog title="信息" :visible.sync="flag" :before-close="handleClose">
  <el-form :model="form">
    <el-form-item label="姓名" :label-width="formLabelWidth">
      <el-input v-model="form.name" auto-complete="off"></el-input>
    </el-form-item>
    <el-form-item label="地址" :label-width="formLabelWidth">
      <el-select v-model="form.region" placeholder="请选择活动区域">
        <el-option label="区域一" value="shanghai"></el-option>
        <el-option label="区域二" value="beijing"></el-option>
      </el-select>
    </el-form-item>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="flag = false ">取 消</el-button>
    <el-button type="primary" @click="submit">确 定</el-button>
  </div>
</el-dialog>
</template>


<script type="text/ecmascript-6">
 export default {
   data() {
      return {
                 flag: this.dialogFormVisible,
                form: {
                    name: '',
                    region: '',
                    date1: '',
                    date2: '',
                    delivery: false,
                    type: [],
                    resource: '',
                    desc: ''
                },
                formLabelWidth: '120px'
            }

   },
   components: {

   },
   methods: {
      handleClose(done) {
       this.flag =false;
      },
      submint:  () => {
        this.$axios.post(self.url, { page: self.cur_page }).then(res => {
        self.tableData = res.data.list;
      });
      }
   },
    watch: {
        dialogFormVisible(newValue, oldValue) {
          console.dir('newValue---------------------'+newValue);
          console.dir('oldValue------------------===='+oldValue);
        this.flag = newValue;//新增result的watch，监听变更并同步到myResult上
        },
        flag(val){
          this.$emit('on-result-change',val);
        }
    },
     mounted () {
    
     this.flag= this.dialogFormVisible;
  },
   props: ['dialogFormVisible'],
   created () {
            console.dir('this.dialogFormVisible-——————————'+this.dialogFormVisible);
         this.flag =  this.dialogFormVisible ;
        },
 }
</script>

